package com.structure.algorithm;

/**
 * big串是否包含small串
 * Created by sucre on 2015/11/16.
 */
public class StringContain {
    private static boolean isStringContain(char[] big,char[] small){
        int hash =0;
        for (int i=0;i<big.length;++i){
            int ss = 1 << (big[i] -'A');
            hash |=ss;
        }
        for (int i=0;i< small.length;++i){
            if((hash & (1 << (small[i] -'A')))==0){
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args){
        char[] big ="abfaaac".toCharArray();
        char[] small = "11".toCharArray();
        boolean b = isStringContain(big,small);
        System.out.print(b);
    }
}
